from threading import Thread
#多个线程操作全局变量，会导致错漏，结果变成随机
value = 0
def getT():
    global value
    for i in range(1000000):
        value+=1

    print('value=%d'%value)

def main():
    for i in range(2):
        t = Thread(target=getT)
        t.start()
if __name__ == '__main__':
   main()
